package validate

import (
	"gin/common"
	"gorm.io/datatypes"
)

type AddEventWrapper struct {
	Data Event `json:"data" binding:"required"`
}
type Event struct {
	Name          string         `json:"name" binding:"max=255"`
	Type          string         `json:"type" binding:"max=20,required"`
	Param         datatypes.JSON `json:"param"`
	Sort          uint8          `json:"sort" binding:"max=65534"`
	PlayId        uint64         `json:"play_id" binding:"required"`
	StoryId       uint64         `json:"story_id" binding:"required"`
	ActionId      uint64         `json:"action_id"`
	PlayRoleId    uint64         `json:"play_role_id"`
	LineMediaId   uint64         `json:"line_media_id"`
	GroupId       uint64         `json:"group_id"`
	ShotId        uint64         `json:"shot_id"`
	LightId       uint64         `json:"light_id"`
	ActionText    string         `json:"action_text" binding:"max=512"`
	ShotText      string         `json:"shot_text" binding:"max=512"`
	LineText      string         `json:"line_text" binding:"max=512"`
	IsSendCommand string         `json:"is_send_command" `
}

type EventUpdateFields struct {
	Data map[string]interface{} `json:"data" binding:"required"`
}
type UpdateEventWrapper struct {
	Data EventUpdate `json:"data" binding:"required"`
}
type EventUpdate struct {
	Id uint64 `json:"id" binding:"required"`
}

type SelectEventQuery struct {
	Param common.QueryParam `json:"param" binding:"required"`
}

type FindEventQuery struct {
	Param common.Filter `json:"param" binding:"required"`
}

type DeleteEventParam struct {
	Param common.Filter `json:"param" binding:"required"`
}

type EventAnalyzingLines struct {
	EventId uint64 `form:"event_id" binding:"required"`
	Type    string `form:"type" binding:"required,oneof=text audio video"`
	Text    string `form:"text"`
}

type UpdateByFilter struct {
	Param common.Filter          `json:"param" binding:"required"`
	Data  map[string]interface{} `json:"data" binding:"required"`
}
